Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improved bottleneck when run out of pokeballs #1280

Merged
merged 1 commit into from
Jul 28, 2016
Merged

Improved bottleneck when run out of pokeballs #1280

merged 1 commit into from
Jul 28, 2016

Conversation

5andr0
Copy link
Contributor

@5andr0 5andr0 commented Jul 28, 2016

Due to the sleep in here this function can delay the walk to a pokestop up to (pokemons around you) * 3 sec. Not sure if it's worth to implement the calls. A check for EventNoPokeballs after the EncounterPokemon with a loop break might be better even though it's after the sleep.

Due to the sleep in here this function can delay the walk to a pokestop up to (pokemons around you) * 3 sec. Not sure if it's worth to implement the calls. A check for EventNoPokeballs after the EncounterPokemon with a loop break might be better even though it's after the sleep.
@maximegmd maximegmd merged commit e7e5da2 into NecronomiconCoding:master Jul 28, 2016
@@ -22,6 +22,14 @@ public static class CatchNearbyPokemonsTask
var pokemons = await GetNearbyPokemons(session);
Copy link

@VitaminPSG VitaminPSG Jul 28, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

var pokeBallsCount = await session.Inventory.GetItemAmountByType(POGOProtos.Inventory.Item.ItemId.ItemPokeBall);
var greatBallsCount = await session.Inventory.GetItemAmountByType(POGOProtos.Inventory.Item.ItemId.ItemGreatBall);
var ultraBallsCount = await session.Inventory.GetItemAmountByType(POGOProtos.Inventory.Item.ItemId.ItemUltraBall);
var masterBallsCount = await session.Inventory.GetItemAmountByType(POGOProtos.Inventory.Item.ItemId.ItemMasterBall);
if (pokeBallsCount + greatBallsCount + ultraBallsCount + masterBallsCount == 0)
return;
Why do you check a condition that will not change in the loop?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants